#ifndef MYQPNGIMAGEWRITER_H
#define MYQPNGIMAGEWRITER_H

#include <QIODevice>
#include <png.h>
#include  <pngconf.h>
#include <pnglibconf.h>
#include <pngpriv.h>
#include <pngstruct.h>
#include <pngdebug.h>
#include "MYQPNGImageWriter.h"
#include "QtGui/qimageiohandler.h"

#ifndef QT_NO_IMAGEFORMAT_PNG

QT_BEGIN_NAMESPACE
#include <osgDB/WriteFile>
#include <osgDB/ReadFile>
class MYQPNGImageWriter
{

public:
     MYQPNGImageWriter();
     ~MYQPNGImageWriter();

    enum DisposalMethod { Unspecified, NoDisposal, RestoreBackground, RestoreImage };
    bool writeImage(osg::Image *img);
    void setDevice(QIODevice* device);

    QIODevice* device() { return dev; }

private:
    QIODevice* dev;
    DisposalMethod disposal;

};
QT_END_NAMESPACE
#endif // QT_NO_IMAGEFORMAT_PNG
#endif // MYQPNGIMAGEWRITER_H
